package net.zjitc.car;

import java.util.Scanner;

/**
 * @Author admin
 * @Date 2019/3/19 16:30
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("请选择你要开哪辆车？");
        System.out.println("1--BMW");
        System.out.println("2--QQ");
        Scanner in =new Scanner(System.in);
         int choose=in.nextInt();
       CarFactory cf=new CarFactory();
       Car car=cf.getCar(choose);
       car.run();
      /** Car car;   if 判断语句选择车辆（多态）
       *  if (choose==1){
          car=new BMW();

        }else {
            car=new QQ();
        }
        car.run();*/
       /**
        *  Driver driver=new Driver();
        Car bmw=new BMW();
        driver.run(bmw);
        Car qq=new QQ();
        driver.run(qq);*/
    }
}
